<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0060)http://nettuts.s3.amazonaws.com/001_Tabbed/site/jQuery.html# -->
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib prefix="c" uri="/WEB-INF/c.tld"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<HTML lang=en xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Permiso Perfil - <c:out value="${method}"/></title>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<SCRIPT src="<%=request.getContextPath()%>/js/jquery.js" type=text/javascript></SCRIPT>
<SCRIPT src="<%=request.getContextPath()%>/js/customselect.js" type=text/javascript></SCRIPT>
<link type="text/css" rel="stylesheet"
	href="<%=request.getContextPath()%>/base/basico.css" />

<script type="text/javascript">
function validaRango(){
var valor1,valor2;

valor1=document.forms[0].valor2.value;
valor2=document.forms[0].valor3.value;

dato=true;

if(valor2<valor1){
dato= false;
}


return dato;
}

function nuevo(){
 
		var f=window.opener.document.forms[0];	
		var ft=document.forms[0],
		codEle=ft.codEle.value,
		valor1=ft.valor1.value,
		valor2=ft.valor2.value,
		valor3=ft.valor3.value,
		valor4=ft.valor4.value;
		validaRango();

		if(!validaRango()){
			alert("El inicio de rango no puede ser mayor al final de rango");
		}else{
					
		//obj="permisoPerfilAction.do?method=nuevo&codPerfil="+codPerfil+"&tipoAcceso="+tipoAcceso+"&valorRCP="+valorRCP;			
		//obj = "tarifaAction.do?method=editar&codEle='+codEle+'&codMult='+codMult+'&valor1='+valor1+'&valor2='+valor2+'&valor3='+valor3+'&valor4='+valor4"
		obj="tarifaAction.do?method=<c:out value="${method}"/>&codEle="+codEle+"&valor1="+valor1+"&valor2="+valor2+"&valor3="+valor3+"&valor4="+valor4;			
		
		window.opener.getUrlInicio(obj);
		window.close();	
		}	
	}
</script>
<script language="javaScript">

var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function ValidarImporte(obj,DnEvents)
{
	 k = (isNN) ? DnEvents.which : window.event.keyCode;
	var cadena=obtenerNumeroPuntosDecimales(obj.value);
 	 
	 if (!(((k > 47) && (k < 58)) || (k == 241) || (k == 209) || (k == 164) || (k == 165) || (k==0) || (k==8) || (k==46)))
	{
		   if(isNN)
		   {
		      return false;
		   }
		 
		   else
		   {
		      event.returnValue = false;
		   }  
		   
	}
   if (k==46 && cadena>=1)
   {
		event.returnValue= false;
		
   }

}

function obtenerNumeroPuntosDecimales(cadena)
 {
 
 var contador = 0;
 for (i=0; i <cadena.length ; i++) 
 {
 if (cadena.charAt(i) == '.') 
 contador=contador + 1;
 }
 return contador;
 
 }

function ValidarNumero(DnEvents)
{
k = (isNN) ? DnEvents.which : window.event.keyCode;
 if (!(((k > 47) && (k < 58))))
// if (!(((k > 47) && (k < 58)) || (k == 241) || (k == 209) || (k == 241) || (k == 209)||(k == 164) || (k == 165) || (k==0) || (k==8)))
	{
		   if(isNN)
		   {
		      return false;
		   }
		   else
		   {
	      event.returnValue = false;
		   }  
	}

}


</script>
<script language="javaScript" >




</script>
</HEAD>
<style type="text/css">td{font-size:9pt;}</style>
<BODY>


<html:form action="/tarifaAction.do?method=mostrarNuevo" >
	<input type="hidden" name="method" />
		
		<table width="50%" height="50%" cellpadding="2" class="tabla_borde busqueda_letra" style="margin: auto;" cellspacing="0" id="permisoPerfil">
		<thead>
		<tr>
		<th colspan="5" align="left"></th>
		</tr>
		<tr>
		<th colspan="3" align="left">TARIFA - <c:out value="${method}"/></th>
		</tr>
		<tr>
		<th colspan="5" align="left"></th>
		</tr>
		</thead>
		<tr class=pihue>
			<td width="1%" height="26"></td>
			<td width="26%">Codigo Elemento: </td>
			<td width="37%"><html:text property="codEle"
				readonly="${codEle}"  styleClass="TEXTINPUT" readonly="true"/></td>
		</tr>
		<tr class=pihue>
			<td width="1%" height="26"></td>
			<td width="26%">Descripcion:</td>
			<td width="37%"><html:text property="valor1"  readonly="${valor1}"
				styleClass="TEXTINPUT" readonly="true" /></td>
		</tr>		
		<tr class=pihue>
			<td height="23">&nbsp;</td>
		    <td>Valor Inicio de Rango</td>
		    <td><html:text maxlength="12" property="valor2" readonly='${valor2}' onkeypress="ValidarNumero(this,event)" styleClass="TEXTINPUT"/>            </td>
		</tr>
			<tr class=pihue>
			<td height="23">&nbsp;</td>
		    <td>Valor Final de Inicio</td>
		    <td><html:text property="valor3" maxlength="12" readonly='${valor3}' onkeypress="ValidarNumero(this,event)" styleClass="TEXTINPUT"/>            </td>
		</tr>
			<tr class=pihue>
			<td height="23">&nbsp;</td>
		    <td>Tarifa S/.</td>
		    <td><html:text property="valor4" maxlength="6" readonly='${valor4}' onkeypress="ValidarImporte(this,event)" styleClass="TEXTINPUT"/>            </td>
		</tr>
		
		<tr class=pihue>
			<td>&nbsp;</td>
			<td colspan="2" align="center"><html:button property="guard"
				styleClass="boton" onclick="nuevo('')" value="Aceptar" /> <html:button
				property="guard" styleClass="boton"
				onclick="javascript: window.close();" value="Cancelar" /></td>
        </tr>
         <tr class=pihue>
			<td>&nbsp;</td>
			<td colspan="2" align="center"></td>
        </tr>
	</table>
</html:form>

</BODY>
</html>
